/**************************************************************************
 *                                                                        *
 *         Copyright (c) 2007 by Sunplus mMedia Inc.                      *
 *                                                                        *
 *  This software is copyrighted by and is the property of Sunplus        *
 *  mMedia Inc. All rights are reserved by Sunplus mMedia Inc.  This      *
 *  software may only be used in accordance with the corresponding        *
 *  license agreement. Any unauthorized use, duplication, distribution,   *
 *  or disclosure of this software is expressly forbidden.                *
 *                                                                        *
 *  This Copyright notice MUST not be removed or modified without prior   *
 *  written consent of Sunplus mMedia Inc.                                *
 *                                                                        *
 *  Sunplus mMedia Inc. reserves the right to modify this software        *
 *  without notice.                                                       *
 *                                                                        *
 *  Sunplus mMedia Inc.                                                   *
 *  19-1, Innovation First Road, Science-Based Industrial Park,           *
 *  Hsin-Chu, Taiwan, R.O.C.                                              *
 *                                                                        *
 **************************************************************************/

#ifndef __DOSDATA_H__
#define __DOSDATA_H__

code	UINT8	G_DOS_SIG[] =
{
/*0x1fe*/       0x55,
/*0x1ff*/       0xaa,
};

#if (CODE_IS_MULTIBANK || (SMC_OPTION == 0 && NANDF_OPTION == 0) || \
	((K_MEDIA_ONLYONE == 0) && (NANDF_OPTION != 0) && (SMC_OPTION == 0)) )
// HIS101b-0012
code	UINT8	G_DOS_PBSP[] =
{
/*0x000*/       0xe9, 0x00, 0x00,       //Jump command
/*0x003*/       'S', 'U', 'N', 'P',     //Manufacturer's name and version (ASCII, 8 bytes) = SUNPLUS
/*0x007*/       'L', 'U', 'S', ' ',
/*0x00b*/       0x00, 0x02,             //Number of bytes per sector = 512
/*0x00d*/       0x20,                   //Number of sectors per cluster = 32
/*0x00e*/       0x01, 0x00,             //Number of reserved sectors = 1
/*0x010*/       0x02,                   //Number of FATs = 2
/*0x011*/       0x00, 0x01,             //Number of root directory entries = 256
/*0x013*/       0xdd, 0xf9,             //Total number of partition sectors = 63965
/*0x015*/       0xf8,                   //ID byte = 0xf8 (HardDisk)
/*0x016*/       0x06, 0x00,             //Number of FAT sectors = 6
/*0x018*/       0x10, 0x00,             //Number of sectors per track = 16
/*0x01a*/       0x08, 0x00,             //Number of heads = 8
/*0x01c*/       0x23, 0x00, 0x00, 0x00, //Number of hidden sectors = 0x23
/*0x020*/       0x00, 0x00, 0x00, 0x00, //Total number of partition sectors = 0 
/*0x024*/       0x00,                   //Physical drive No.
/*0x025*/       0x00,                   //Reserved
/*0x026*/       0x29,                   //Extended boot record signatures
/*0x027*/       0x00, 0x00, 0x00, 0x00, //Volume ID (4 bytes)
/*0x02b*/       0x00, 0x00, 0x00, 0x00, //Volume label (ASCII, 11 bytes)
/*0x02f*/       0x00, 0x00, 0x00, 0x00,      
/*0x033*/       0x00, 0x00, 0x00,       
/*0x036*/       0x46, 0x41, 0x54, 0x31, //File system type (ASCII, 8 bytes) = FAT12
/*0x03a*/       0x32, 0x20, 0x20, 0x20,
};                   

#else

#if (P_NAND_SIZE>=128 || P_NAND_SIZE==0) // @012403@wyeo@support 256M nand
code	UINT8	G_DOS_MBSP_128M[] =
{
/*0x1be*/       0x80,                   //Boot ID = bootable partition
/*0x1bf*/       0x01,                   //Start head No.	
/*0x1c0*/       0x01,                   //Start sector No.	// HIS101b-0012, 0x10 to 0x01
/*0x1c1*/       0x00,                   //Start cynlinder No.
/*0x1c2*/       0x06,                   //System ID = FAT16
/*0x1c3*/       0x0f,                   //End head No.
/*0x1c4*/       0x60,                   //End sector No.
/*0x1c5*/       0xf3,                   //End cynlinder No.
/*0x1c6*/       0x2f, 0x00, 0x00, 0x00, //Start logical sector No. = 0x0000002f
/*0x1ca*/       0xd1, 0xe7, 0x03, 0x00, //Partition size = 255953
};

code	UINT8	G_DOS_PBSP_128M[] =
{
/*0x000*/       0xe9, 0x00, 0x00,       //Jump command
/*0x003*/       'S', 'U', 'N', 'P',     //Manufacturer's name and version (ASCII, 8 bytes) = SUNPLUS
/*0x007*/       'L', 'U', 'S', ' ',
/*0x00b*/       0x00, 0x02,             //Number of bytes per sector = 512
/*0x00d*/       0x20,                   //Number of sectors per cluster = 32
/*0x00e*/       0x01, 0x00,             //Number of reserved sectors = 1
/*0x010*/       0x02,                   //Number of FATs = 2
/*0x011*/       0x00, 0x01,             //Number of root directory entries = 256
/*0x013*/       0x00, 0x00,             //Total number of partition sectors = 0
/*0x015*/       0xf8,                   //ID byte = 0xf8 (HardDisk)
/*0x016*/       0x20, 0x00,             //Number of FAT sectors = 32
/*0x018*/       0x20, 0x00,             //Number of sectors per track = 32
/*0x01a*/       0x10, 0x00,             //Number of heads = 16
/*0x01c*/       0x2f, 0x00, 0x00, 0x00, //Number of hidden sectors = 0x2f
/*0x020*/       0xd1, 0xe7, 0x03, 0x00, //Total number of partition sectors = 255953
/*0x024*/       0x00,                   //Physical drive No.
/*0x025*/       0x00,                   //Reserved
/*0x026*/       0x29,                   //Extended boot record signatures // HIS101b-0012, 0x00 to 0x29
/*0x027*/       0x00, 0x00, 0x00, 0x00, //Volume ID (4 bytes)
/*0x02b*/       0x00, 0x00, 0x00, 0x00, //Volume label (ASCII, 11 bytes)
/*0x02f*/       0x00, 0x00, 0x00, 0x00,      
/*0x033*/       0x00, 0x00, 0x00,       
/*0x036*/       0x46, 0x41, 0x54, 0x31, //File system type (ASCII, 8 bytes) = FAT16
/*0x03a*/       0x36, 0x20, 0x20, 0x20,
};                   
#endif

#if (P_NAND_SIZE==64 || P_NAND_SIZE==0)
code	UINT8	G_DOS_MBSP_64M[] =
{
/*0x1be*/       0x80,                   //Boot ID = bootable partition
/*0x1bf*/       0x01,                   //Start head No.
/*0x1c0*/       0x01,                   //Start sector No.	// HIS101b-0012, 0x18 to 0x01
/*0x1c1*/       0x00,                   //Start cynlinder No.
/*0x1c2*/       0x01,                   //System ID = FAT12
/*0x1c3*/       0x07,                   //End head No.
/*0x1c4*/       0x60,                   //End sector No.
/*0x1c5*/       0xf3,                   //End cynlinder No.
/*0x1c6*/       0x37, 0x00, 0x00, 0x00, //Start logical sector No. = 0x00000037
/*0x1ca*/       0xc9, 0xf3, 0x01, 0x00, //Partition size = 127945
};

code	UINT8	G_DOS_PBSP_64M[] =
{
/*0x000*/       0xe9, 0x00, 0x00,       //Jump command
/*0x003*/       'S', 'U', 'N', 'P',     //Manufacturer's name and version (ASCII, 8 bytes) = SUNPLUS
/*0x007*/       'L', 'U', 'S', ' ',
/*0x00b*/       0x00, 0x02,             //Number of bytes per sector = 512
/*0x00d*/       0x20,                   //Number of sectors per cluster = 32
/*0x00e*/       0x01, 0x00,             //Number of reserved sectors = 1
/*0x010*/       0x02,                   //Number of FATs = 2
/*0x011*/       0x00, 0x01,             //Number of root directory entries = 256
/*0x013*/       0x00, 0x00,             //Total number of partition sectors = 0
/*0x015*/       0xf8,                   //ID byte = 0xf8 (HardDisk)
/*0x016*/       0x0c, 0x00,             //Number of FAT sectors = 12
/*0x018*/       0x20, 0x00,             //Number of sectors per track = 32
/*0x01a*/       0x08, 0x00,             //Number of heads = 8
/*0x01c*/       0x37, 0x00, 0x00, 0x00, //Number of hidden sectors = 0x37
/*0x020*/       0xc9, 0xf3, 0x01, 0x00, //Total number of partition sectors = 127945
/*0x024*/       0x00,                   //Physical drive No.
/*0x025*/       0x00,                   //Reserved
/*0x026*/       0x29,                   //Extended boot record signatures // HIS101b-0012, 0x00 to 0x29
/*0x027*/       0x00, 0x00, 0x00, 0x00, //Volume ID (4 bytes)
/*0x02b*/       0x00, 0x00, 0x00, 0x00, //Volume label (ASCII, 11 bytes)
/*0x02f*/       0x00, 0x00, 0x00, 0x00,      
/*0x033*/       0x00, 0x00, 0x00,       
/*0x036*/       0x46, 0x41, 0x54, 0x31, //File system type (ASCII, 8 bytes) = FAT12
/*0x03a*/       0x32, 0x20, 0x20, 0x20,
};                   
#endif

#if (P_NAND_SIZE==32|| P_NAND_SIZE==0)
code	UINT8	G_DOS_MBSP_32M[] =
{
/*0x1be*/       0x80,                   //Boot ID = bootable partition
/*0x1bf*/       0x01,                   //Start head No.	// HIS101b-0012, 0x02 to 0x01
/*0x1c0*/       0x01,                   //Start sector No.	// HIS101b-0012, 0x04 to 0x01
/*0x1c1*/       0x00,                   //Start cynlinder No.
/*0x1c2*/       0x01,                   //System ID = FAT12
/*0x1c3*/       0x07,                   //End head No.
/*0x1c4*/       0x50,                   //End sector No.
/*0x1c5*/       0xf3,                   //End cynlinder No.
/*0x1c6*/       0x23, 0x00, 0x00, 0x00, //Start logical sector No. = 0x00000023
/*0x1ca*/       0xdd, 0xf9, 0x00, 0x00, //Partition size = 63965
};

code	UINT8	G_DOS_PBSP_32M[] =
{
/*0x000*/       0xe9, 0x00, 0x00,       //Jump command
/*0x003*/       'S', 'U', 'N', 'P',     //Manufacturer's name and version (ASCII, 8 bytes) = SUNPLUS
/*0x007*/       'L', 'U', 'S', ' ',
/*0x00b*/       0x00, 0x02,             //Number of bytes per sector = 512
/*0x00d*/       0x20,                   //Number of sectors per cluster = 32
/*0x00e*/       0x01, 0x00,             //Number of reserved sectors = 1
/*0x010*/       0x02,                   //Number of FATs = 2
/*0x011*/       0x00, 0x01,             //Number of root directory entries = 256
/*0x013*/       0xdd, 0xf9,             //Total number of partition sectors = 63965
/*0x015*/       0xf8,                   //ID byte = 0xf8 (HardDisk)
/*0x016*/       0x06, 0x00,             //Number of FAT sectors = 6
/*0x018*/       0x10, 0x00,             //Number of sectors per track = 16
/*0x01a*/       0x08, 0x00,             //Number of heads = 8
/*0x01c*/       0x23, 0x00, 0x00, 0x00, //Number of hidden sectors = 0x23
/*0x020*/       0x00, 0x00, 0x00, 0x00, //Total number of partition sectors = 0 
/*0x024*/       0x00,                   //Physical drive No.
/*0x025*/       0x00,                   //Reserved
/*0x026*/       0x29,                   //Extended boot record signatures // HIS101b-0012, 0x00 to 0x29
/*0x027*/       0x00, 0x00, 0x00, 0x00, //Volume ID (4 bytes)
/*0x02b*/       0x00, 0x00, 0x00, 0x00, //Volume label (ASCII, 11 bytes)
/*0x02f*/       0x00, 0x00, 0x00, 0x00,      
/*0x033*/       0x00, 0x00, 0x00,       
/*0x036*/       0x46, 0x41, 0x54, 0x31, //File system type (ASCII, 8 bytes) = FAT12
/*0x03a*/       0x32, 0x20, 0x20, 0x20,
};                   
#endif

#if (P_NAND_SIZE==16 || P_NAND_SIZE==0)
code	UINT8	G_DOS_MBSP_16M[] =
{
/*0x1be*/       0x80,                   //Boot ID = bootable partition
/*0x1bf*/       0x01,                   //Start head No.	// HIS101b-0012, 0x02 to 0x01
/*0x1c0*/       0x01,                   //Start sector No.	// HIS101b-0012, 0x0a to 0x01
/*0x1c1*/       0x00,                   //Start cynlinder No.
/*0x1c2*/       0x01,                   //System ID = FAT12
/*0x1c3*/       0x03,                   //End head No.
/*0x1c4*/       0x50,                   //End sector No.
/*0x1c5*/       0xf3,                   //End cynlinder No.
/*0x1c6*/       0x29, 0x00, 0x00, 0x00, //Start logical sector No. = 0x00000029
/*0x1ca*/       0xd7, 0x7c, 0x00, 0x00, //Partition size = 31959
};

code	UINT8	G_DOS_PBSP_16M[] =
{
/*0x000*/       0xe9, 0x00, 0x00,       //Jump command
/*0x003*/       'S', 'U', 'N', 'P',     //Manufacturer's name and version (ASCII, 8 bytes) = SUNPLUS
/*0x007*/       'L', 'U', 'S', ' ',
/*0x00b*/       0x00, 0x02,             //Number of bytes per sector = 512
/*0x00d*/       0x20,                   //Number of sectors per cluster = 32
/*0x00e*/       0x01, 0x00,             //Number of reserved sectors = 1
/*0x010*/       0x02,                   //Number of FATs = 2
/*0x011*/       0x00, 0x01,             //Number of root directory entries = 256
/*0x013*/       0xd7, 0x7c,             //Total number of partition sectors = 31959
/*0x015*/       0xf8,                   //ID byte = 0xf8 (HardDisk)
/*0x016*/       0x03, 0x00,             //Number of FAT sectors = 3
/*0x018*/       0x10, 0x00,             //Number of sectors per track = 16
/*0x01a*/       0x04, 0x00,             //Number of heads = 4
/*0x01c*/       0x29, 0x00, 0x00, 0x00, //Number of hidden sectors = 0x29
/*0x020*/       0x00, 0x00, 0x00, 0x00, //Total number of partition sectors = 0 
/*0x024*/       0x00,                   //Physical drive No.
/*0x025*/       0x00,                   //Reserved
/*0x026*/       0x29,                   //Extended boot record signatures // HIS101b-0012, 0x00 to 0x29
/*0x027*/       0x00, 0x00, 0x00, 0x00, //Volume ID (4 bytes)
/*0x02b*/       0x00, 0x00, 0x00, 0x00, //Volume label (ASCII, 11 bytes)
/*0x02f*/       0x00, 0x00, 0x00, 0x00,      
/*0x033*/       0x00, 0x00, 0x00,       
/*0x036*/       0x46, 0x41, 0x54, 0x31, //File system type (ASCII, 8 bytes) = FAT12
/*0x03a*/       0x32, 0x20, 0x20, 0x20,
};                   
#endif

#if (P_NAND_SIZE==8 || P_NAND_SIZE==0)
code	UINT8	G_DOS_MBSP_8M[] =
{
/*0x1be*/       0x80,                   //Boot ID = bootable partition
/*0x1bf*/       0x01,                   //Start head No.
/*0x1c0*/       0x01,                   //Start sector No.	// HIS101b-0012, 0x0a to 0x01
/*0x1c1*/       0x00,                   //Start cynlinder No.
/*0x1c2*/       0x01,                   //System ID = FAT12
/*0x1c3*/       0x03,                   //End head No.
/*0x1c4*/       0x10,                   //End sector No.
/*0x1c5*/       0xf9,                   //End cynlinder No.
/*0x1c6*/       0x19, 0x00, 0x00, 0x00, //Start logical sector No. = 0x00000019
/*0x1ca*/       0x67, 0x3e, 0x00, 0x00, //Partition size = 31959
};

code	UINT8	G_DOS_PBSP_8M[] =
{
/*0x000*/       0xe9, 0x00, 0x00,       //Jump command
/*0x003*/       'S', 'U', 'N', 'P',     //Manufacturer's name and version (ASCII, 8 bytes) = SUNPLUS
/*0x007*/       'L', 'U', 'S', ' ',
/*0x00b*/       0x00, 0x02,             //Number of bytes per sector = 512
/*0x00d*/       0x10,                   //Number of sectors per cluster = 16
/*0x00e*/       0x01, 0x00,             //Number of reserved sectors = 1
/*0x010*/       0x02,                   //Number of FATs = 2
/*0x011*/       0x00, 0x01,             //Number of root directory entries = 256
/*0x013*/       0x67, 0x3e,             //Total number of partition sectors = 15975
/*0x015*/       0xf8,                   //ID byte = 0xf8 (HardDisk)
/*0x016*/       0x03, 0x00,             //Number of FAT sectors = 3
/*0x018*/       0x10, 0x00,             //Number of sectors per track = 16
/*0x01a*/       0x04, 0x00,             //Number of heads = 4
/*0x01c*/       0x19, 0x00, 0x00, 0x00, //Number of hidden sectors = 0x19
/*0x020*/       0x00, 0x00, 0x00, 0x00, //Total number of partition sectors = 0 
/*0x024*/       0x00,                   //Physical drive No.
/*0x025*/       0x00,                   //Reserved
/*0x026*/       0x29,                   //Extended boot record signatures // HIS101b-0012, 0x00 to 0x29
/*0x027*/       0x00, 0x00, 0x00, 0x00, //Volume ID (4 bytes)
/*0x02b*/       0x00, 0x00, 0x00, 0x00, //Volume label (ASCII, 11 bytes)
/*0x02f*/       0x00, 0x00, 0x00, 0x00,      
/*0x033*/       0x00, 0x00, 0x00,       
/*0x036*/       0x46, 0x41, 0x54, 0x31, //File system type (ASCII, 8 bytes) = FAT12
/*0x03a*/       0x32, 0x20, 0x20, 0x20,
};                   
#endif

#if (P_NAND_SIZE==4 || P_NAND_SIZE==0)

code	UINT8	G_DOS_MBSP_4M[] =
{
/*0x1be*/       0x80,                   //Boot ID = bootable partition
/*0x1bf*/       0x01,                   //Start head No.	// HIS101b-0012, 0x03 to 0x01
/*0x1c0*/       0x01,                   //Start sector No.	// HIS101b-0012, 0x04 to 0x01
/*0x1c1*/       0x00,                   //Start cynlinder No.
/*0x1c2*/       0x01,                   //System ID = FAT12
/*0x1c3*/       0x03,                   //End head No.
/*0x1c4*/       0x08,                   //End sector No.
/*0x1c5*/       0xf9,                   //End cynlinder No.
/*0x1c6*/       0x1b, 0x00, 0x00, 0x00, //Start logical sector No. = 0x0000001b
/*0x1ca*/       0x25, 0x1f, 0x00, 0x00, //Partition size = 7973
};

code	UINT8	G_DOS_PBSP_4M[] =
{
/*0x000*/       0xe9, 0x00, 0x00,       //Jump command
/*0x003*/       'S', 'U', 'N', 'P',     //Manufacturer's name and version (ASCII, 8 bytes) = SUNPLUS
/*0x007*/       'L', 'U', 'S', ' ',
/*0x00b*/       0x00, 0x02,             //Number of bytes per sector = 512
/*0x00d*/       0x10,                   //Number of sectors per cluster = 16
/*0x00e*/       0x01, 0x00,             //Number of reserved sectors = 1
/*0x010*/       0x02,                   //Number of FATs = 2
/*0x011*/       0x00, 0x01,             //Number of root directory entries = 256
/*0x013*/       0x25, 0x1f,             //Total number of partition sectors = 7973 
/*0x015*/       0xf8,                   //ID byte = 0xf8 (HardDisk)
/*0x016*/       0x02, 0x00,             //Number of FAT sectors = 2
/*0x018*/       0x08, 0x00,             //Number of sectors per track = 8 
/*0x01a*/       0x04, 0x00,             //Number of heads = 4
/*0x01c*/       0x1b, 0x00, 0x00, 0x00, //Number of hidden sectors = 0x19
/*0x020*/       0x00, 0x00, 0x00, 0x00, //Total number of partition sectors = 0 
/*0x024*/       0x00,                   //Physical drive No.
/*0x025*/       0x00,                   //Reserved
/*0x026*/       0x29,                   //Extended boot record signatures // HIS101b-0012, 0x00 to 0x29
/*0x027*/       0x00, 0x00, 0x00, 0x00, //Volume ID (4 bytes)
/*0x02b*/       0x00, 0x00, 0x00, 0x00, //Volume label (ASCII, 11 bytes)
/*0x02f*/       0x00, 0x00, 0x00, 0x00,      
/*0x033*/       0x00, 0x00, 0x00,       
/*0x036*/       0x46, 0x41, 0x54, 0x31, //File system type (ASCII, 8 bytes) = FAT12
/*0x03a*/       0x32, 0x20, 0x20, 0x20,
};
     
#endif                  
#endif

code	UINT8	G_DOS_DirCurrentParent[64] =
{
        //current directory
        0x2E, 0x20, 0x20, 0x20,                 //0x00, file name
        0x20, 0x20, 0x20, 0x20, 
        0x20, 0x20, 0x20,                       //0x08, extension
        0x10,                                   //0x0B, attribute
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,     //0x0C, reserved
        0x00, 0x00,                             //0x12, last access date
        0x00, 0x00,                             //0x14, reserved    
        0x00, 0x00,                             //0x16, creation time, H*2048+M*32+S*2
        0x21, 0x00,                             //0x18, creation date, (Y-1980)*512+M*32+D
        0x00, 0x00,                             //0x1A, start cluster number
        0x00, 0x00, 0x00, 0x00,                 //0x1C, file size
        //parent directory
        0x2E, 0x2E, 0x20, 0x20,                 //0x00, file name
        0x20, 0x20, 0x20, 0x20,
        0x20, 0x20, 0x20,                       //0x08, extension
        0x10,                                   //0x0B, attribute
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,     //0x0C, reserved
	0x00, 0x00,                             //0x12, last access date
        0x00, 0x00,                             //0x14, reserved
        0x00, 0x00,                             //0x16, creation time, H*2048+M*32+S*2
        0x21, 0x00,                             //0x18, creation date, (Y-1980)*512+M*32+D
        0x00, 0x00,                             //0x1A, start cluster number
        0x00, 0x00, 0x00, 0x00                  //file size
};

#endif /*__DOSDATA_H__*/